<%--
  Created by IntelliJ IDEA.
  User: hd
  Date: 2021/11/18
  Time: 19:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fm" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">

<!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous">

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>

<html>
<head>
    <title>Title</title>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <style>
        .ca{
          position: relative;
            left: 630px;
        }
    </style>
</head>
<body>
<h1 class="ca">文档传输</h1>
<div class="container">
    <div class="row">
        <div class="col-md-10 col-offset-1">
            <select>
                <option>选择类型</option>
                <c:forEach items="${mse}" var="b">
                    <option class="shuax">${b.name}
                    </option>
                </c:forEach>
                <a href="#" class="ss">
                    <span class="glyphicon glyphicon-search" aria-hidden="true"/>
                </a>
            </select>
            <a class="ca" href="/user/add">
            <button type="button" class="btn btn-primary btn-lg active">新增</button>
            </a>
            <table class="table table-hover table-striped table-bordered">
                <thead>
                    <tr>
                        <td>文档编号</td>
                        <td>文档名称</td>
                        <td>文档摘要</td>
                        <td>上传人</td>
                        <td>上传时间</td>
                        <td>操作</td>
                    </tr>
                </thead>
               <tbody>
                   <c:forEach items="${msg.list}" var="a" >
                       <tr>
                           <td>${a.id}</td>
                           <td>${a.title}</td>
                           <td>${a.summary}</td>
                           <td>${a.uploaduser}</td>
                           <td>
                               <fm:formatDate value="${a.createdate}" pattern="yyyy年MM月dd日"/>
                           </td>
                           <td>
                               <a href="/user/upada?id=${a.id}" class="btn btn-primary btn-lg active" role="button">修改</a>
                               <button type="button" class="dele btn btn-primary btn-lg active">删除</button>
                           </td>
                       </tr>
                   </c:forEach>

               </tbody>

                <tfoot>
                <tr class="text-center">
                <td colspan="9">
                    <nav aria-label="Page navigation">
                        <ul class="pagination">
                            <li>
                                <a href="/user/tz?pageIndex=${msg.pageNum-1}" aria-label="Previous">
                                    <span aria-hidden="true">&laquo;</span>
                                </a>
                            </li>
                            <c:forEach items="${msg.navigatepageNums}" var="i">
                                <li><a href="/user/tz?pageIndex=${i}">${i}</a></li>
                            </c:forEach>
                            <li>
                                <a href="/user/tz?pageIndex=${msg.pageNum+1}" aria-label="Next">
                                    <span aria-hidden="true">&raquo;</span>
                                </a>
                            </li>
                        </ul>
                    </nav>
                </td>
                </tr>
                </tfoot>
            </table>
        </div>
    </div>
</div>
<script>
    $(function () {
        $(".dele").click(function () {
            let number=$(this).parents("tr").children().first().text();
            if (confirm("是否删除此文档")) {
                    location.href="/user/del?id="+number;
                alert("删除成功");
            }
        });
    })
</script>
</body>
</html>
